package com.peach.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class News {
    private Integer newsId;
    private Integer newsTypeId;
    private String newsTitle;
    private String newsContent;
    private String newsAuthor;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date newsDate;
    private Integer newsClick;
    private NewsType newsType;

    public News(Integer newsTypeId, String newsTitle, String newsContent, String newsAuthor, Date newsDate, Integer newsClick) {
        this.newsTypeId = newsTypeId;
        this.newsTitle = newsTitle;
        this.newsContent = newsContent;
        this.newsAuthor = newsAuthor;
        this.newsDate = newsDate;
        this.newsClick = newsClick;
    }
}
